{
  "$schema" : "http://json-schema.org/draft/2019-09/schema#",
  "title" : "Recurring Pre Payments",
  "type" : "object",
  "additionalProperties" : false,
  "properties" : {
    "jobCode" : {
      "type" : "string",
      "maxLength" : 20,
      "description" : "Unique identfier of the CMP job that produces this extract file."
    },
    "jobDescription" : {
      "type" : "string",
      "description" : "A short description of the CMP job that produces this extract file."
    },
    "interfaceCategory" : {
      "type" : "string",
      "maxLength" : 20,
      "enum" : [ "Payments" ],
      "description" : "CMP categorization of the job that produces this extract file."
    },
    "interfaceType" : {
      "type" : "string",
      "maxLength" : 24,
      "enum" : [ "Card Pre Payments" ],
      "description" : "CMP sub-categorization of the job that produces this extract file."
    },
    "version" : {
      "type" : "number",
      "minimum" : 1.1,
      "maximum" : 1.1,
      "description" : "The current version of the generic extract file. This must match the corresponding inbound file."
    },
    "batchDateTime" : {
      "type" : "string",
      "format" : "date-time",
      "description" : "Timestamp indicating when the batch was created in CMP."
    },
    "extractDateTime" : {
      "type" : "string",
      "format" : "date-time",
      "description" : "Timestamp indicating when the generic extract file was created."
    },
    "extractUpToDate" : {
      "type" : "string",
      "format" : "date-time",
      "description" : " Only payments due on or before this date are included in the extract file."
    },
    "recordCount" : {
      "type" : "integer",
      "minimum" : 0,
      "description" : "Total number of transaction records in the extract file."
    },
    "paymentTotal" : {
      "type" : "number",
      "minimum" : 0.0,
      "maximum" : 9.9999999999E8,
      "description" : "Total value of payment transactions in the extract file."
    },
    "details" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/RecurringPrePaymentsDetail"
      }
    },
    "id" : {
      "type" : "integer",
      "description" : "Unique identifier for each generic extract file that is produced by CMP."
    }
  },
  "required" : [ "version", "recordCount", "paymentTotal", "id" ],
  "definitions" : {
    "RecurringPrePaymentsDetail" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "detailSequence" : {
          "type" : "integer",
          "description" : "Unique identifier of the detail record within the file"
        },
        "accountNumber" : {
          "type" : "integer",
          "minimum" : 1,
          "maximum" : 99999999,
          "description" : "The unique identifier for the account in CMP."
        },
        "paymentType" : {
          "type" : "string",
          "description" : "CMP code representing the type of card e.g. VISA, MASTER"
        },
        "amount" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 9.9999999999E8,
          "description" : "Amount of the payment or refund"
        },
        "transactionNumber" : {
          "type" : "integer",
          "minimum" : 1,
          "maximum" : 99999999,
          "description" : "Unique identifier of the payment/refund transaction. This should be included in requests that are sent to third-party systems"
        },
        "nameOnCard" : {
          "type" : "string",
          "maxLength" : 30,
          "description" : "Card holder name."
        },
        "cardNumber" : {
          "type" : "string",
          "maxLength" : 20,
          "description" : "Card number or portion of number, typically last 4 digits."
        },
        "startDateYymm" : {
          "type" : "string",
          "description" : "Year and month that the card is valid from."
        },
        "endDateYymm" : {
          "type" : "string",
          "description" : "Year and month that the card is valid until."
        },
        "cardReferenceNumber" : {
          "type" : "string",
          "maxLength" : 100,
          "description" : "Identifier or token that uniquely identifies the credit/debit card on a third party payments system."
        },
        "cardType" : {
          "type" : "string",
          "description" : "Credit or debit card indicator."
        }
      },
      "required" : [ "accountNumber", "amount" ]
    }
  }
}